Skip to content

chore(prettier): adopt Prettier with a CI format gate - #68

Merged
sandstream merged 3 commits into
mainfrom
chore/adopt-prettier
Jun 23, 2026
Merged

sandstream merged 3 commits into
mainfrom
chore/adopt-prettier

Conversation

@sandstream

Copy link
Copy Markdown
Owner

What

Adopts Prettier for the TypeScript codebase (356 .ts files previously had no formatter), with a CI gate so formatting stays consistent.

  • .prettierrc tuned to the existing style — double quotes, semicolons, 2-space, trailing commas, printWidth: 100 — so the reformat is minimal-churn rather than a style change (measured: p90 line length 77, p99 110).
  • .prettierignore excludes dist/, deps, cloud-sync conflict copies (* 2.ts), and data files (*.jsonl, lockfile, .kit/).
  • format / format:check npm scripts.
  • A Format check step in CI (runs before lint).
  • .git-blame-ignore-revs records the mechanical reformat commit so git blame stays useful.

Prettier is a dev-only dependency — the published package stays zero-runtime-dep.

Why

It's the one dev-ergonomics gap relative to sibling repos: no formatter on a large TS codebase means style drift and review noise. The hooks/security tooling here are already strong; this just adds auto-format + a gate.

Commits

  1. chore(prettier) — config, scripts, CI gate (review this one).
  2. style — mechanical prettier --write reformat (whitespace only, no behaviour change).
  3. chore — add the reformat SHA to .git-blame-ignore-revs.

Scope / follow-ups

  • This PR formats .ts only. JSON/Markdown/YAML can follow in a separate PR to keep this diff reviewable.
  • No eslint-config-prettier needed — the ESLint config has no formatting rules to conflict with.
  • Possible next steps from the same review: enforce the already-followed Conventional Commits via commitlint (unlocks automated changelog/release), and adopt stricter tsconfig flags (noUncheckedIndexedAccess, noFallthroughCasesInSwitch).

Verification

  • npm run format:check clean; npm run lint 0 errors (pre-existing warnings only).
  • Every committed .ts blob verified prettier-clean at the git-object level.

🤖 Generated with Claude Code

sandstream and others added 3 commits June 23, 2026 14:25
- add .prettierrc matching the codebase style (double quotes, semis, 2-space,
  trailing commas, printWidth 100) and .prettierignore (dist, conflict copies, data)
- add format / format:check npm scripts
- add a Format check step to CI (runs before lint)
- prettier as a dev-only dependency (published package stays zero-runtime-dep)

No eslint formatting-rule conflicts exist, so eslint-config-prettier is not needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mechanical reformat (`prettier --write`) — whitespace only, no behaviour change.
Recorded in .git-blame-ignore-revs in the following commit so `git blame` skips it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedprettier@​3.8.4981009794100

View full report

@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 66f275d into main Jun 23, 2026
16 checks passed
@sandstream
sandstream deleted the chore/adopt-prettier branch June 23, 2026 13:25
sandstream added a commit that referenced this pull request Jun 27, 2026
- prettier-format opencode.{ts,test.ts} — the format:check gate (from #68) was red
- order a message's text parts by part id, not filesystem-walk order, so a
  multi-part message reassembles in order rather than arbitrarily
- populate result.filesSkipped for unparseable message files (was always 0)

All 3 opencode tests pass; format:check clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant